package com.springboot.hikersystemapp.service;

import com.springboot.hikersystemapp.domain.Team;
import com.springboot.hikersystemapp.domain.TeamMember;
import com.springboot.hikersystemapp.domain.User;

import java.util.List;

public interface ServiceInterface {
     /**
     * 注册业务逻辑
     * @param user 要注册的User
     * @return
     */
    User registService(User user);

    /**
     * 登录业务逻辑
     * @param user 要登录的User
     * @return
     */
    User loginService(User user);

    /**
     * 登陆后修改业务逻辑
     * @param userId,oldPassword,newPassword
     * @return
     */
    boolean changePassword(Long userId, String oldPassword, String newPassword);

    /**
     * 登录后修改用户名业务逻辑
     * @param userId,newUsername
     * @return
     */
    boolean changeUsername(Long userId, String newUsername);

    /**
     * 展示注册驴友业务逻辑(用于创建队伍时发送组队邀请)
     * @param
     * @return
     */
    List<User> getUserList();

    /**
     * 创建队伍业务逻辑(并设登录User为管理员)
     * @param user,team
     * @return
     */
    Team createTeam(User user, Team team);

    /**
     * 展示可加入队伍业务逻辑(队伍人数已满关闭组队功能和队伍管理功能)
     * @param
     * @return
     */
    List<Team> getJoinableTeams(User user);

    /**
     * 发送组队申请业务逻辑(即将登录User设为申请Team的TeamMember)
     * @param user,team
     * @return
     */
    void setTeamMember(User user, Team team);

    /**
     * 获取组队申请列表业务逻辑(查找登录User为Admin的Team的一些TeamMembers)
     * @param user
     * @return
     */
    List<TeamMember> getApplicationList(User user);

    /**
     * 审核队伍申请业务逻辑
     * @param user,teamMember
     * @return
     */
    TeamMember approveTeamMember(User user,TeamMember teamMember);
}
